﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Yuekao.API.Read.Command;
using Yuekao.Domain.API;
using Yuekao.Domain.dto;
using Yuekao.Domain.Entitys;

namespace Yuekao.API.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AccountController : ControllerBase
    {
        private readonly IMediator mediator;

        public AccountController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 科室显示
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<Office>> GetOffice([FromQuery]GetOfficeCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 职称列表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<Work>> GetWork([FromQuery]GetWorkCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 医生管理
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<DoctorDto>> GetDoctor([FromQuery]GetDoctorCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 医生详情
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<DoctorDetailDto>> GetDoctorDetail([FromQuery]GetDoctorDetailsCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 审批详情
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<Reject>> GetReject([FromQuery]GetRejectCommandcs request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 服务
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<ServiceDto>>> GetService([FromQuery]GetServiceCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 医生排班
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<Scheduling>> GetSched([FromQuery]GetSchedulingCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 粉丝
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPagging<Fan>> GetFan([FromQuery]GetFanCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
